/*
 * @Author: xun
 * @Date: 2021-02-10 10:59:22
 * @LastEditTime: 2021-02-11 17:28:16
 * @LastEditors: xun
 * @Description: In User Settings Edit
 * @FilePath: \demo_2021021001\include\common\initfunc.h
 */

#ifndef __INITFUNC_H__
#define __INITFUNC_H__

typedef void (*init_call)(void);

extern init_call _init_start;
extern init_call _init_end;
extern init_call _fun_end;

//__attribute__((section("section_name")))
#define _init1 __attribute__((unused, section(".myinit1")))
#define _init2 __attribute__((unused, section(".myinit2")))

#define DECLARE_INIT(func) init_call _fn_##func _init1 = func
#define DECLARE_RUN(func) init_call _fn_##func _init2 = func

#endif